﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.ComponentModel.Composition;
using Caliburn.Micro.BikeWizard.Views;

namespace Caliburn.Micro.BikeWizard.Tests.Utils
{
    /// <summary>
    /// Factory for BikeWizardViewModel objects.
    /// 
    /// This is a a bit of a workaround. It would be better if it would be possible to register an ExportFactory<T> in the MEF container
    /// without relying on [Export] attributes, but I wasn't able to find out how.
    /// </summary>
    [Export]
    public class BikeWizardViewModelFactory
    {
        #region Private properties
        private ExportFactory<BikeWizardViewModel> bikeWizardViewModelFactory;
        #endregion

        #region Constructors
        [ImportingConstructor]
        public BikeWizardViewModelFactory(
            ExportFactory<BikeWizardViewModel> bikeWizardViewModelFactory)
        {
            this.bikeWizardViewModelFactory = bikeWizardViewModelFactory;
        }
        #endregion

        #region Public Methods
        public BikeWizardViewModel CreateInstance()
        {
            return bikeWizardViewModelFactory.CreateExport().Value;
        }
        #endregion
    }
}
